/*
 *  WilNoteDblClickHandler.cpp
 *  Wilson
 *
 *  Created by Sebastian Orfino on 1/26/12.
 *  Copyright 2012 lbs3. All rights reserved.
 *
 */


#include "VCPlugInHeaders.h"


//sdk includes
#include "IPageItemEventAction.h"
#include "IEvent.h"
#include "IPMUnknown.h"

//project includes
#include "WilID.h"
#include "IWilNoteData.h"
#include "xmp_facade.h"
#include "dblclic_en_marcador_report.h"
#include "csxs_facade.h"


class WilNoteDblClickHandler : public CPMUnknown<IPageItemEventAction> {

public:
	
	WilNoteDblClickHandler(IPMUnknown* boss):CPMUnknown<IPageItemEventAction>(boss) {}
	virtual ~WilNoteDblClickHandler() {}
	
	virtual bool16 ButtonDblClk(IEvent*e);
	virtual bool16 ButtonTrplClk(IEvent *e);

};

CREATE_PMINTERFACE( WilNoteDblClickHandler, kWilNoteDblClickHandlerImpl )

bool16 WilNoteDblClickHandler::ButtonDblClk(IEvent * event)
{
	do {
		InterfacePtr<IWilNoteData> noteData(this,UseDefaultIID());
		BREAK_IF(!noteData);

		eventos::dblclic_en_marcador_report evt;
		evt.nota().id = noteData->uid().str();
		
		wilson::despachar(evt);
		
		return kTrue;
	} while(false);
	
	return kFalse;
}


bool16 WilNoteDblClickHandler::ButtonTrplClk(IEvent *)
{
	return kFalse;
}